def inp():
    data_l = []
    num = int(input())
    for i in range(0,num):
        data = input()
        data_l.append(data)
    return data_l[:]
        
def strlist(s):
    temp = ''
    l = []
    for i in range(0,len(s)):
        if s[i] != ' ':
            temp += s[i]
        else:
            l.append(temp)
            temp = ''
    l.append(temp)
    return l[:]

def strint(l):
    for i in range(0,len(l)):
        l[i] = int(l[i])
        
def do(data):
    if 2 * max(data) > sum(data):
        print(sum(data)-max(data))
    else:
        print(sum(data) * 0.5)
        
def main():
    data_l = inp()
    strlist(data_l)
    strint(data_l)
    do(data_l)
    
main()